package com.wuzihao.disk.register.control;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("/register")
public class RegisterController {

    @RequestMapping("/page")
    public String registerPage() {
        return "register/registerPage";
    }

    @RequestMapping("/submit")
    @ResponseBody
    public Map<String, Object> submitRegister(String username, String password, String mobile) {
        Map<String, Object> result = new HashMap<>();

        // 这里应该添加用户信息到数据库的逻辑
        // 由于没有实际的Service和Dao，这里只是模拟
        System.out.println("注册用户: " + username + ", 手机: " + mobile);

        result.put("success", true);
        result.put("message", "register.success");
        return result;
    }
}